import request from '@/utils/request'

// 应付金额
export const onPlay = (params) => {
  return request({
    params,
    method: 'get',
    url: '/UserFinance/AmountConsume'
  })
}
// 查询汇率;
export const findExchangeRates = () => {
  return request({
    method: 'get',
    url: 'findExchangeRates'
  })
}

// 创建一个支付订单
export const createCustomer = (data) => {
  return request({
    method: 'post',
    url: '/UserFinance/CreateCustomer',
    data
  })
}
//消耗趋势
export const generalView = (params) => {
  return request({
    params,
    method: 'get',
    url: '/Ufconsume/findStartEndTimeZi'

  })
}

// 追加预算接口
export const dataOrder = (data) => {
  return request({
    data,
    method: 'post',
    url: '/serFinance/dataOrder'
  })
}

// 发起支付宝请求
export const alipay = (data) => {
  return request({
    data,
    method: 'post',
    url: '/alipay/pay'
  })
}

// 支付宝充值接口;
export const setzfb = (data) => {
  return request({
    data,
    method: 'post',
    url: 'pay'
  })
}


// 支付宝充值校验接口;
export const setzfbreturnurl = (params) => {
  return request({
    params,
    method: 'get',
    url: 'return_url'
  })
}

// http://192.168.0.114:8223/Ufconsume/findUfconsumeconsumption?userId=10044&startTime=2021-01-21&endTime=2021-01-26
// 当日消耗统计
export const findUfconsumeconsumption = (params) => {
  return request({
    params,
    method: 'get',
    url: '/Ufconsume/findUfconsumeconsumption'
  })
}

// 查询管理员账号
export const managerAccount = () => {
  return request({
    method: 'get',
    url:'/UserRefund/findUserRefIhome'
  })
}
// 查询用户冻结余额
export const freezeUblance = (params) => {
  return request({
    params,
    method: 'get',
    url: 'wuser/freezeUblance'
  })
}

// 查询用户充值总额
export const uTotalAmount = (params) => {
  return request({
    params,
    method: 'get',
    url: 'TotalAmount/UMURTotalAmount'
  })
}

// 消耗占比
export const findSumUfc = (params) => {
  return request({
    params,
    method: 'get',
    url: '/Ufconsume/findSumUfc'
  })
}

export const txMoney = (data) => {
  return request({
    data,
    method: 'post',
    url: '/UserRefund/Toapplyfor'
  })
}

//昨日消费总额
export const findDayUfconsume = (params) => {
  return request({
    params,
    method: 'get',
    url: 'Ufconsume/findDayUfconsume'
  })
}

// 所有消耗总额
export const findOneUserUfconsume = (params) => {
  return request({
    params,
    method: 'get',
    url: 'Ufconsume/findOneUserUfconsume'
  })
}

// campaign消耗占比
export const campaignTotal = (params) => {
  return request({
    params,
    method: 'get',
    url: '/Ufconsume/campaignTotal'
  })
}

// 日消耗趋势
export const trendSumUfc = (params) => {
  return request({
    params,
    method: 'get',
    url: '/Ufconsume/TrendSumUfc'
  })
}

// 获取用户充值记录  图表
export const AllTotalAmount = (params) => {
  return request({
    params,
    method: 'get',
    url: 'TotalAmount/AllTotalAmount'
  })
}

// 消耗分页查询
export const findUserUfconsume = (params) => {
  return request({
    params,
    method: 'get',
    url: 'Ufconsume/findUserUfconsume'
  })
}
// 充值提现分页查询
export const topHistory = (params) => {
  return request({
    params,
    method: 'get',
    url: 'UserRecharge/TopHistory'
  })
}

// 广告系列统计
export const campaignStatistics = (params) => {
  return request({
    params,
    method: 'get',
    url: 'Ufconsume/campaignStatistics'
  })
}

// 获取用户财务记录
// http://192.168.0.114:8223/UserFinance/findAllUserFinance?userId=10044&startTime=2021-01-26&endTime=2021-01-26&page=1&size=10
export const findAllUserFinance = (params) => {
  return request({
    params,
    method: 'get',
    url: 'UserFinance/findAllUserFinance'
  })
}





// 查询用户信息
export const accountuser = () => {
  return request({
    method: 'get',
    url: 'account/user'
  })
}




// 获取用户最近充值信息
export const findUserRechargeTime = (params) => {
  return request({
    params,
    method: 'get',
    url: 'UserRecharge/findUserRechargeTime'
  })
}


// 获取用户充值记录
export const findUserRechargeList = (params) => {
  return request({
    params,
    method: 'get',
    url: 'UserRecharge/findUserRechargeList'
  })
}
// 匹配搜索用户充值记录
export const findUserRechargeUser = (params) => {
  return request({
    params,
    method: 'get',
    url: 'UserRecharge/findUserRechargeUser'
  })
}


// 修改手动充值记录
export const updateUmRecharge = (data) => {
  return request({
    data,
    method: 'post',
    url: 'Umanualrecharge/updateUmRecharge',

  })
}


// 获取全部用户信息
export const userAll = (params) => {
  return request({
    params,
    method: 'get',
    url: '/wuser/userAll',
  })
}

// 后台新增手动充值记录
export const intUmRecharge = (data) => {
  return request({
    data,
    method: 'post',
    url: 'Umanualrecharge/intUmRecharge',
  })
}



// 获取全部用户充值记录
export const findAllUserRecharge = (params) => {
  return request({
    params,
    method: 'get',
    url: '/UserRecharge/findAllUserRecharge'
  })
}


// 用户查询充值记录的接口
export const findOneTimeUserRecharge = (params) => {
  return request({
    params,
    method: 'get',
    url: 'UserRecharge/findOneTimeUserRecharge'
  })
}
